#include <iostream>
#include <functional>
using namespace std;

struct Pair
{
    int data;
    double source;
};

class MyPair
{
public:
    MyPair() {}
    void func(int x,int y)
    {
        cout<<"func x "<<x<<" ,y "<<y<<endl;
    }
};

int main()
{
Pair p{10,2000};
    auto obj = bind(&Pair::data,p);//绑定一个成员
    cout<<obj()<<endl;

    MyPair mp;
    auto m_obj = bind(&MyPair::func,mp,std::placeholders::_1,2);
    m_obj(10,20);

    return 0;
}
